3.6.4 \(\int (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n} \, dx\) [504]

Optimal. Leaf size=40 \[ \frac {i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{-n}}{f n} \]

[Out]

I*a*(d*sec(f*x+e))^(2*n)/f/n/((a+I*a*tan(f*x+e))^n)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.031, Rules used = {3574} \begin {gather*} \frac {i a (a+i a \tan (e+f x))^{-n} (d \sec (e+f x))^{2 n}}{f n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Sec[e + f*x])^(2*n)*(a + I*a*Tan[e + f*x])^(1 - n),x]

[Out]

(I*a*(d*Sec[e + f*x])^(2*n))/(f*n*(a + I*a*Tan[e + f*x])^n)

Rule 3574

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[2*b*(
d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^(n - 1)/(f*m)), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2
, 0] && EqQ[Simplify[m/2 + n - 1], 0]

Rubi steps

\begin {align*} \int (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n} \, dx &=\frac {i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{-n}}{f n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.48, size = 40, normalized size = 1.00 \begin {gather*} \frac {i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{-n}}{f n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d*Sec[e + f*x])^(2*n)*(a + I*a*Tan[e + f*x])^(1 - n),x]

[Out]

(I*a*(d*Sec[e + f*x])^(2*n))/(f*n*(a + I*a*Tan[e + f*x])^n)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.96, size = 1291, normalized size = 32.28

method result size
risch \(\text {Expression too large to display}\) \(1291\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*sec(f*x+e))^(2*n)*(a+I*a*tan(f*x+e))^(1-n),x,method=_RETURNVERBOSE)

[Out]

I/f*a*a^(-n)*2^n*d^(2*n)*exp(-1/2*I*Pi*(-2*n*csgn(I/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+
e))+1))^2-2*n*csgn(I*exp(I*(f*x+e)))*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2-2*n*csgn(I*exp(I*(f*x+e))/(
exp(2*I*(f*x+e))+1))*csgn(I*d/(exp(2*I*(f*x+e))+1)*exp(I*(f*x+e)))^2-2*n*csgn(I*d)*csgn(I*d/(exp(2*I*(f*x+e))+
1)*exp(I*(f*x+e)))^2-2*csgn(I*exp(I*(f*x+e)))*csgn(I*exp(2*I*(f*x+e)))^2+csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x
+e))+1))^3+2*n*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3-n*csgn(I*exp(2*I*(f*x+e)))^3-n*csgn(I*exp(2*I*(f*
x+e))/(exp(2*I*(f*x+e))+1))^3-n*csgn(I*a/(exp(2*I*(f*x+e))+1)*exp(2*I*(f*x+e)))^3+2*n*csgn(I*d/(exp(2*I*(f*x+e
))+1)*exp(I*(f*x+e)))^3-csgn(I*a)*csgn(I*a/(exp(2*I*(f*x+e))+1)*exp(2*I*(f*x+e)))^2-csgn(I/(exp(2*I*(f*x+e))+1
))*csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2+csgn(I*exp(I*(f*x+e)))^2*csgn(I*exp(2*I*(f*x+e)))-csgn(I*ex
p(2*I*(f*x+e)))*csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2-csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))*
csgn(I*a/(exp(2*I*(f*x+e))+1)*exp(2*I*(f*x+e)))^2+csgn(I*exp(2*I*(f*x+e)))^3+csgn(I*a/(exp(2*I*(f*x+e))+1)*exp
(2*I*(f*x+e)))^3-n*csgn(I/(exp(2*I*(f*x+e))+1))*csgn(I*exp(2*I*(f*x+e)))*csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x
+e))+1))-n*csgn(I*a)*csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*a/(exp(2*I*(f*x+e))+1)*exp(2*I*(f*x+
e)))+2*n*csgn(I/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e)))*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))+2*n*c
sgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*d)*csgn(I*d/(exp(2*I*(f*x+e))+1)*exp(I*(f*x+e)))+n*csgn(I/(e
xp(2*I*(f*x+e))+1))*csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2-n*csgn(I*exp(I*(f*x+e)))^2*csgn(I*exp(2*I*
(f*x+e)))+n*csgn(I*a)*csgn(I*a/(exp(2*I*(f*x+e))+1)*exp(2*I*(f*x+e)))^2+csgn(I/(exp(2*I*(f*x+e))+1))*csgn(I*ex
p(2*I*(f*x+e)))*csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))+2*n*csgn(I*exp(I*(f*x+e)))*csgn(I*exp(2*I*(f*x+e
)))^2+n*csgn(I*exp(2*I*(f*x+e)))*csgn(I*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2+n*csgn(I*exp(2*I*(f*x+e))/(ex
p(2*I*(f*x+e))+1))*csgn(I*a/(exp(2*I*(f*x+e))+1)*exp(2*I*(f*x+e)))^2+csgn(I*a)*csgn(I*exp(2*I*(f*x+e))/(exp(2*
I*(f*x+e))+1))*csgn(I*a/(exp(2*I*(f*x+e))+1)*exp(2*I*(f*x+e)))))*(exp(2*I*(f*x+e))+1)^(-n)/n

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (38) = 76\).
time = 0.52, size = 147, normalized size = 3.68 \begin {gather*} \frac {i \, a^{-n + 1} d^{2 \, n} e^{\left (-n \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right ) - n \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right ) - n \log \left (-\frac {2 i \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1\right ) + 2 \, n \log \left (-\frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1\right )\right )}}{f n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^(2*n)*(a+I*a*tan(f*x+e))^(1-n),x, algorithm="maxima")

[Out]

I*a^(-n + 1)*d^(2*n)*e^(-n*log(sin(f*x + e)/(cos(f*x + e) + 1) + 1) - n*log(sin(f*x + e)/(cos(f*x + e) + 1) -
1) - n*log(-2*I*sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^2/(cos(f*x + e) + 1)^2 - 1) + 2*n*log(-sin(f*x
+ e)^2/(cos(f*x + e) + 1)^2 - 1))/(f*n)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 125 vs. \(2 (38) = 76\).
time = 0.39, size = 125, normalized size = 3.12 \begin {gather*} \frac {\left (\frac {2 \, d e^{\left (i \, f x + i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{2 \, n} {\left (i \, e^{\left (2 i \, f x + 2 i \, e\right )} + i\right )} e^{\left ({\left (-i \, f n + i \, f\right )} x - 2 i \, f x + {\left (-i \, n + i\right )} e - {\left (n - 1\right )} \log \left (\frac {2 \, d e^{\left (i \, f x + i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right ) - {\left (n - 1\right )} \log \left (\frac {a}{d}\right ) - 2 i \, e\right )}}{2 \, f n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^(2*n)*(a+I*a*tan(f*x+e))^(1-n),x, algorithm="fricas")

[Out]

1/2*(2*d*e^(I*f*x + I*e)/(e^(2*I*f*x + 2*I*e) + 1))^(2*n)*(I*e^(2*I*f*x + 2*I*e) + I)*e^((-I*f*n + I*f)*x - 2*
I*f*x + (-I*n + I)*e - (n - 1)*log(2*d*e^(I*f*x + I*e)/(e^(2*I*f*x + 2*I*e) + 1)) - (n - 1)*log(a/d) - 2*I*e)/
(f*n)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d \sec {\left (e + f x \right )}\right )^{2 n} \left (i a \left (\tan {\left (e + f x \right )} - i\right )\right )^{1 - n}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))**(2*n)*(a+I*a*tan(f*x+e))**(1-n),x)

[Out]

Integral((d*sec(e + f*x))**(2*n)*(I*a*(tan(e + f*x) - I))**(1 - n), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^(2*n)*(a+I*a*tan(f*x+e))^(1-n),x, algorithm="giac")

[Out]

integrate((d*sec(f*x + e))^(2*n)*(I*a*tan(f*x + e) + a)^(-n + 1), x)

________________________________________________________________________________________

Mupad [B]
time = 4.59, size = 62, normalized size = 1.55 \begin {gather*} \frac {a\,{\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^{2\,n}\,1{}\mathrm {i}}{f\,n\,{\left (\frac {a\,\left (\cos \left (2\,e+2\,f\,x\right )+1+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{2\,{\cos \left (e+f\,x\right )}^2}\right )}^n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d/cos(e + f*x))^(2*n)*(a + a*tan(e + f*x)*1i)^(1 - n),x)

[Out]

(a*(d/cos(e + f*x))^(2*n)*1i)/(f*n*((a*(cos(2*e + 2*f*x) + sin(2*e + 2*f*x)*1i + 1))/(2*cos(e + f*x)^2))^n)

________________________________________________________________________________________